﻿// 1.1.4.05. Write a program that reads two positive integer numbers and prints how many numbers p exist
// between them such that the reminder of the division by 5 is 0 (exclusive). Example: p(17,25) = 1.

using System;

class FindingDividendsOfFive
{
    static void Main()
    {
        Console.Write("Please enter any integer number: ");
        int firstNum = int.Parse(Console.ReadLine());
        Console.Write("Please enter one more integer number: ");
        int secondNum = int.Parse(Console.ReadLine());
        int counter = 0;
        if (firstNum > secondNum)
        {
            firstNum += secondNum;
            secondNum = firstNum - secondNum;
            firstNum = firstNum - secondNum;
        }

        for (int i = firstNum + 1; i < secondNum; i++)
		{
			if (i % 5 == 0)
            {
                counter++;
            }
		}
        Console.WriteLine("There are {0} dividends by 5 betwen your numbers.", counter);
        // Console.WriteLine("There are {0} dividends by 5 betwen your numbers.", (Math.Max(firstNum, secondNum) / 5) - ((Math.Min(firstNum, secondNum) - 1) / 5));
    }
}